CC = g++
src = $(wildcard ./*.cpp)
obj = $(patsubst %.c, %.o, $(src))
# obj = $(src:%.c=%.o) 正则表达式法，功能同 patsubst
target = main

$(target): $(obj)
	$(CC) $(obj) -o $(target)
%.o: %.c
	$(CC) -c $< -o $@


.PHONY: clean
clean:
	$(RM) main.exe